updated version with all necessary parts