Full implementation done (not optimized)