improving haar like feature implementation
working version of algorithm