removed function and simplified to vars