added basic interpolation and if/else loop