Code from advanced programming class