fixed bilinear interpolation in project 2 and optimized speed