fixed code to use modules