finished adding preliminary code