started with ex1. takes too much time to compute