pylinted and cleaned up code