code cleaned up from last commit