Implemented Parsa's suggestions