Cleaned up Diana's code