Working program- basically copied Mike's.