removed printf statements for better profiling
merged