Updated Code and removed Warnings