added most important code