optimizes untaken position function
removes comment