Cleaned up code - part 3