addressed JM's various concerns with my code
removed unecessary double type assertion