code for endless platform