Lab 5 - Combined most functions into one megakernel