Made the TileEntity code more.. versatile