revert back and better code