WIP-Added rest of code - needs bug/typo checking