This works but need to clean up and work on comments.