improved x/y locking

lock with x or y
todo added in comments