made shorter, maybe more complex though?
added obvious test