Some code tweaks. Implemented HP instead of AB