added private and public functionality