Finished code for PC, Mac's