Adding in more functionality - actually returning codes now