init and modified previous implementation