V1.0 Tested with and without using threads