polished the code a little