Messed up a function in last commit, replaced from earlier file.