Use data instead of throwaway_data for slope and short-circuit || instead of if(...