used namespace std; implemented constructor