Fixed bug, now stable along z axis