First attempt at psudocode added