code a pattern to follow desired positions