Bug Fix + Optimization