working on front tracking subroutine: create front algorithm