Finish input handling. Better position calculation