cleaned code and added some pseudo code for open cv stuff