Updated and fixed some Code