Minor tweaks and changes to better optimize the code. As well as fixxed slide6