Cleaned up prototype code