make lots of changes as per documentation