added code to follow spec