polished code, removed comments