tired coding, first raw version wroks, should get the remaining logic within an hour or two of work