changed initialize function to be the constructor