Cleaned up code, made checkbox inactive when it should be