updated with functional improvements