working code, need to add exit funcionality and return speed