added many iff statments to look around the curent position