implemented tab key, fixed end level.