Changed code to store time taken for proficiency exercises. Optimized code: relaced len() with count() when checking if data is already in the database.