changed success color and optimized codes