static code made into dynamic