Modified for making it work in Eclipse.