graphics added, minor modifications to code