putting max hr condition; cleaning the js continued
Finalized Logic and Implementation