lots of changes made as per documentation