main with part 3

hey guys please check this following code with your code. I believe it
should work. let me know if it gives you errors