improved and tested face detecion